package pw.canyingisme.plugin.action;

import org.bukkit.Bukkit;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import pw.canyingisme.plugin.occupation.OccupationHealth;

public class ActionList {
    public static void ApplyTntBoom(LivingEntity Player){
        TNTPrimed tntPrimed = (TNTPrimed)
        Player.getWorld().spawnEntity(Player.getLocation(), EntityType.PRIMED_TNT);
        tntPrimed.setFuseTicks(0);
    }
    public static void addFood(LivingEntity Player){
        org.bukkit.entity.Player player= Bukkit.getPlayer(Player.getName());
        if(player.getFoodLevel()==20){
            return;
        }player.setFoodLevel(player.getFoodLevel()+1);
    }
    public static void removeFood(LivingEntity Player){
        org.bukkit.entity.Player player= Bukkit.getPlayer(Player.getName());
        if(player.getFoodLevel()==0){
            return;
        }player.setFoodLevel(player.getFoodLevel()-1);
    }
    public static void addHealth(LivingEntity Player){
        org.bukkit.entity.Player player= Bukkit.getPlayer(Player.getName());
        if (Player.getHealth()==OccupationHealth.getPlayerMaxHealth(player)){
            return;
        }Player.setHealth(Player.getHealth()+1);
    }
    public static void removeHealth(LivingEntity Player){
        if (Player.getHealth()==0){
            return;
        }Player.setHealth(Player.getHealth()-1);
    }
    public static void run15s(LivingEntity Player){
        PotionEffect effect = new PotionEffect(PotionEffectType.SPEED, 300, 3);
        effect.apply(Player);
    }
    public static void run30s(LivingEntity Player){
        PotionEffect effect = new PotionEffect(PotionEffectType.SPEED, 600, 3);
        effect.apply(Player);
    }
}
